Code Example of Checking if a variable is None using is operator

35

# Declaring a None variable
var = None

if var is None: # Checking if the variable is None
  print("None")
else:
  print("Not None")

Comments

Submit
0 Comments